package chenji.itemeditor.itemeditor;

public enum AttributeSlot {
	MAINHAND("mainhand"), OFFHAND("offhand"), HEAD("head"), LEGS("legs"), CHEST("chest"), FEET("feet");
	private String name;

	private AttributeSlot(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	public static AttributeSlot loadFromString(String name) {
		if (name == null) {
			return null;
		}
		name = name.toLowerCase();
		switch (name) {
		case "mainhand":
			return AttributeSlot.MAINHAND;
		case "offhand":
			return AttributeSlot.OFFHAND;
		case "head":
			return AttributeSlot.HEAD;
		case "legs":
			return AttributeSlot.LEGS;
		case "chest":
			return AttributeSlot.CHEST;
		case "feet":
			return AttributeSlot.FEET;
		}
		return null;
	}
}
